
import java.util.Arrays;
import java.util.Scanner;

public class 数组倒转 {
    public static void main(String[] args) {
        int[] arr = new int[6];
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = scanner.nextInt();
        }
        int j = arr.length - 1; //获取最后一个元素的下标
        System.out.println(Arrays.toString(arr)); //反转前打印
        //因为我们需要反转 次数就等于他的长度的一半
        for (int i = 0 ; i < arr.length / 2 ; i++) {
            int temp = arr[i]; //用到临时变量来接受
            arr[i] = arr[j];
            arr[j] = temp;
            j--;//让下标--
        }
        System.out.println(Arrays.toString(arr));
    }
}